package com.xdjmall.util;

import java.util.Arrays;
import java.util.List;

public class SQLHandler {
	public static String joinIn(Integer[] ids) {
		StringBuffer sb = new StringBuffer(" in (");
		for(Integer id : ids) {
			sb.append(id).append(",");
		}
		int length = sb.length();
		sb.delete(length -1, length);
		sb.append(") ");
		return sb.toString();
	}
	
	public static String joinIn(List<Integer> ids) {
		return  ids.isEmpty() ? "":joinIn((Integer[])ids.toArray());
	}
}
